import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/Login.vue'
import Register from '@/views/Register.vue'
import adminLoginVue from '@/views/adminLogin.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect:'/login'
    },
    {
      path:'/login',
      name:'login',
      component:Login,
    },
    {
      path:'/register',
      name:'rigister',
      component:Register
    },
    {
      path:'/home',
      name:'home',
      component:import('@/views/home/Home.vue'),
      redirect: '/home/index',
      children:[
        {name:'index',path:'index',component:import('@/views/home/Index.vue')},
        {name:'patientManagement',path:'patientManagement',component:import('@/views/home/userManagement/PatientManagement.vue')},
        {name:'doctorManagement',path:'doctorManagement',component:import('@/views/home/doctorMannagement/DoctorManagement.vue')},
        {name:'appointmentFor',path:'appointmentFor',component:import('@/views/home/notice/AppointmentInformation.vue')},
        {name:'noticeInformation',path:'noticeInformation',component:import('@/views/home/notice/NoticeInformation.vue')},
        {name:'banner',path:'banner',component:import('@/views/home/banner/Banner.vue')},
        {name:'userRegister',path:'userRegister',component:import('@/views/home/userManagement/UserRegister.vue')},
        {name:'doctorRegister',path:'doctorRegister',component:import('@/views/home/doctorMannagement/DoctorRegister.vue')},
        {name:'addLog',path:'addLog',component:import('@/views/home/log/AddLog.vue')},
        {name:'searchLog',path:'searchLog',component:import('@/views/home/log/SearchLog.vue')},
      ]
    },
    {
      path:'/adminLogin',
      name:'adminLogin',
      component:adminLoginVue
    }
  ]
})

export default router
